package linked;

import link.Node;
import list.MyList;

public class MyLinkedList<T> implements MyList<T> {
    private int size;
    private Node<T> first;
    private Node<T> last;

    @Override
    public boolean add(T date) {
        if (first==null){

        }
        return false;
    }

    @Override
    public boolean add(int index, T date) {
        if (index<0||index>size){
            throw new RuntimeException("插入下标越界");
        }

        Node<T> node=new Node<T>(date);
        if (index==size){  //判断是否为空

        }
        return false;
    }

    @Override
    public T remove(T date) {

        return null;
    }

    @Override
    public T remove(int index) {
        if (index<0||index>=size){
            throw new RuntimeException("元素下标越界");
        }
         Node<T> p=first;
        T oldDate=null;
        if (index==0){

        }
        return null;
    }

    @Override
    public boolean set(int index, T date) {
        return false;
    }

    @Override
    public T getValue(int index) {

        return null;
    }

    @Override
    public int size() {
        return size;
    }
}
